#include <bits/stdc++.h>

using namespace std;

#define int long long

void solve()
{
    int n, x;
    cin >> n >> x;
    vector<int>a(n + 1);
    int l = 1e5, r = -1;
    for(int i = 0;i < n;i ++)
    {
        int door;
        cin >> door;
        if(door == 1)
        {
            l = min(l , i);
            r = max(r , i);
        }
    }
    cout << (x >= r - l + 1 ? "Yes" : "No") << endl;
}
signed main()
{
    int t; cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}